package org.lyimg.com.imgapplication.RetrofitHelper;

import io.reactivex.Observable;
import okhttp3.ResponseBody;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Url;

public interface HttpRetrofitService {

    //利用Retrofit2网络框架创建一个被观察者对象。
    @GET("/daohang.html")
    Observable<ResponseBody> getImgType();

    // @GET注解的作用:采用Get方法发送网络请求
    // 如果想直接获得Responsebody中的内容，可以定义网络请求返回值为Observable<ResponseBody>
    //如果返回的是json可以用实体类
    //    Observable<List<ImgType>> getImgType();
//    users/{user}/repos
    @Headers({
            "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
            "Connection: keep-alive",
            "platform: 2",
            "appVersion: 3.2.0"
    })
    @GET
    Observable<ResponseBody> getImgAllList(@Url String link);

    @Headers({
            "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
            "Connection: keep-alive",
            "platform: 2",
            "appVersion: 3.2.0"
    })
    @GET
    Observable<ResponseBody> getImgShowList(@Url String link);

}
